<div class="datasource_manage_container ml" id="datasource_manage_container">
    <div class="page-header">
        <h1 class="page-title">数据源管理</h1>
        <div class="btns">
            <button type="button" id="add_btn" data-toggle="modal" class="btn btn-text editOrAdd" form_type="info" onClick="datasource_manageView.fn.edit(this,0)">
                添加
            </button>
        </div>
    </div>
    <div class="container-fluid page-content s-height">
        <div class="widget ml">
            <div class="row height-p-100">
                <div class="col-md-12 height-p-100">
                    <div class="row">
                        <form action="" id="bank_branch_form">
                            <input type="hidden" name="departmentId">
                            <div class="col-md-3 form-group">
                                <div class="row">
                                    <label class="col-md-4 form-group-label">
                                        <div>数据类型</div>
                                    </label>
                                    <div class="col-md-8">
                                        <select class="selectpicker form-control" data-live-search="true" data-plugin="selectpicker" name="dataType">
                                            <option value="">全部</option>
                                            <option value="0">oracle</option>
                                            <option value="1">hive</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3 form-group">
                                <div class="row">
                                    <label class="col-md-4 form-group-label">
                                        <div>数据源名称</div>
                                    </label>
                                    <div class="col-md-8">
                                        <input class="form-control dsName-search" name="dsName" type="text" value="" data-v="len:0-30" data-m="最多可输入30个字符">
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3 form-group">
                                <div class="row">
                                    <label class="col-md-4 form-group-label">
                                        <div>是否可用</div>
                                    </label>
                                    <div class="col-md-8">
                                        <select class="selectpicker form-control" data-plugin="selectpicker"  name="connStatus">
                                            <option value="">全部</option>
                                            <option value="1">是</option>
                                            <option value="0">否</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3 form-group text-right">
                                <div class="row">
                                    <div class="col-md-12">
                                        <button type="button" class="btn btn-primary" id="search_btn">搜索</button>
                                        <button type="reset" class="btn btn-default" id="reset-btn">重置</button>

                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="s-height bank-content">
                        <div class="ml wd-table-container padding-bottom-0">
                            <table class="table table-striped table-bordered table-hover table-condensed" id="datasource_manage_list" cellspacing="0">
                                <thead>
                                    <tr>
                                        <th data-field="dataTypeName">数据类型</th>
                                        <th width="200px" data-field="dsName">数据源名称</th> 
                                        <th data-field="ip">服务器IP</th>
                                        <th  data-field="userName">用户名</th>
                                        <th  data-field="connStatusName">是否可用</th>
                                        <th  data-type="operation" data-render="datasource_manageView.fn.render.operation">操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="./../../static/modules/datasource_manage/datasource_manage.js"></script>
</div>

<div id="datasourcemanage_add_container">
    <form class="form-horizontal" id="datasourcemanage_add_form" autocomplete="off">
        <input type="hidden" class="id" name="id" value="">
        <input type="hidden" class="connStatus" name="connStatus" value="0">
        <div class="form-group form-group-dataType">
            <label class="col-sm-3 control-label">
                <span class="star">*</span>数据源类型：</label>
            <div class="col-sm-9">
                <select class="selectpickerAdd dataType" data-plugin="selectpicker" name="dataType" data-v="notempty" data-m="数据源名称不能为空"
                    onchange="datasource_manageView.fn.chooseData(this)">
                    <option value="">请选择</option>
                    <option value="0">oracle</option>
                    <option value="1">hive</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">
                <span class="star">*</span>数据源名称：</label>
            <div class="col-sm-9">
                <input class="form-control dsName" name="dsName" data-v="notempty,len:0-30" data-m="数据源名称不能为空,最多可输入30个字符" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">
                <span class="star">*</span>服务器IP：</label>
            <div class="col-sm-9">
                <input class="form-control ip" name="ip" data-v="notempty,ip" data-m="服务器IP名称不能为空,请输入正确的ip地址" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">
                <span class="star">*</span>端口：</label>
            <div class="col-sm-9">
                <input class="form-control port" name="port" data-v="notempty\,regexp:^([0-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$"
                    data-m="端口号不能为空,只可输入0-65536" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">
                <span class="star">*</span>用户名：</label>
            <div class="col-sm-9">
                <input class="form-control username" name="userName" data-v="notempty,len:0-20" data-m="用户名不能为空,最多可输入20个字符" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">
                <span class="star">*</span>密码：</label>
            <div class="col-sm-9">
                <input class="form-control password" name="password" data-v="notempty,len:0-20" data-m="密码不能为空,最多可输入20个字符" type="password">
            </div>
        </div>
        <div class="form-group form-db-name hide">
            <label class="hide col-sm-3 control-label add-sid">
                <span class="star">*</span>SID：</label>
            <label class="hide col-sm-3 control-label add-dbName">
                <span class="star">*</span>数据库名称：</label>
            <div class="col-sm-9">
                <input class="form-control sid" name="dbName" data-v="notempty,len:0-8" data-m="SID不能为空,最多可输入8个字符" type="text">
            </div>
        </div>
        <!-- <div class="form-group add-dbName">
            <label class="col-sm-3 control-label">
                <span class="star">*</span>数据库名称：</label>
            <div class="col-sm-9">
                <input class="form-control dbName" name="dbName" data-v="notempty,len:0-20" data-m="SID不能为空,最多可输入20个字符" type="text">
            </div>
        </div> -->
        <div class="text-center footer">
            <button type="button" onclick="datasource_manageView.fn.testConnection()"  class="btn btn-default cancel_btn" type="edit">测试连接
            </button>
            <button type="button" onclick="datasource_manageView.fn.dataSourceEdit()" class="btn btn-primary enter_btn save_btn" type="add" >提交</button>
        </div>
    </form>
</div>